package com.zcy.web;

import com.zcy.domain.User;
import com.zcy.feign.UserClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/zcy")
public class ConsumerFeignController {
    @Autowired
    private UserClient userClient;
    @GetMapping("/{id}")
    public User getById(@PathVariable("id") Long id) {
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>经过Feign");
        return userClient.findById(id);
    }
}
